<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>盗听图书</title>
  <link rel="stylesheet" href="{{ url_for('static',filename='layui/css/layui.css') }}">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo"><img src="{{ url_for('static',filename='images/img2.png') }}" style="width: 50px"/>盗听图书</div>
    <ul class="layui-nav layui-layout-right">
        <li class="layui-nav-item"><a href="/welcome" target="mainFrame"><span class="layui-icon layui-icon-home"></span> 主页</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
            <span class="layui-icon layui-icon-user"></span> 用户
        </a>
        <dl class="layui-nav-child">
          <dd><a href="/user" target="mainFrame"><span class="layui-icon layui-icon-username"></span> 个人中心</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="/exit"><span class="layui-icon layui-icon-logout"></span> 登出</a></li>
    </ul>
  </div>

  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;"><span class="layui-icon layui-icon-app"></span> 图书库</a>
          <dl class="layui-nav-child">
            <dd ><a href="/bookList" target="mainFrame"><span class="layui-icon layui-icon-read "></span> 图书列表</a></dd>
            <dd><a href="/analysis" target="mainFrame"><span class="layui-icon layui-icon-list"></span> 统计分析</a></dd>
          </dl>
        </li>
          <li class="layui-nav-item">
            <a href="javascript:;"><span class="layui-icon layui-icon-rmb"></span> 购物中心</a>
            <dl class="layui-nav-child">
                <dd><a href="/Wishlist" target="mainFrame"><span class="layui-icon layui-icon-form"></span> 愿望单</a></dd>
                <dd><a href="/ShoppingCart" target="mainFrame"><span class="layui-icon layui-icon-cart"></span> 购物车</a></dd>
            </dl>
          </li>
            <li class="layui-nav-item">
                <a href="javascript:;"><span class="layui-icon layui-icon-console"></span> 管理员中心</a>
                <dl class="layui-nav-child">
                    <dd><a href="/userList" target="mainFrame"><span class="layui-icon layui-icon-set-fill"></span> 用户列表</a></dd>
                    <dd><a href="/Bookmanage" target="mainFrame"><span class="layui-icon layui-icon-set-fill"></span> 书籍管理</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;"><span class="layui-icon layui-icon-friends"></span> 机器人</a>
                <dl class="layui-nav-child">
                    <dd><a href="robot" target="mainFrame"><span class="layui-icon layui-icon-headset"></span> 机器人聊天</a></dd>
                </dl>
            </li>

      </ul>
    </div>
  </div>

  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
{#        innerframe#}
        <iframe name="mainFrame" src="/welcome"  width="100%" height="600px" frameborder="0">

        </iframe>
    </div>
  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    &copy;2021-2022 Copy Right
  </div>
</div>
<script src="{{ url_for('static',filename='jquery/jquery-3.5.1.min.js') }}"></script>
<script src="{{ url_for('static',filename='layui/layui.js') }}"></script>
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;

});
</script>
<script>
    //JavaScript代码区域
    layui.use(['element',"util"], function(){
        var element = layui.element;
        var util=layui.util
        //固定块
        util.fixbar({
            bar1: "说"
            ,bar2: false
            ,css: {right: 50, bottom: 100}
            ,bgcolor: '#FF0000'
            ,click: function(type){
                if(type === 'bar1'){
                    layer.msg('您请说：')
                    $.ajax({
                        url:"/say",
                        success:function (result){
                            layer.msg(result)
                        },
                        error:function (e){
                            layer.msg('请求服务器失败！')
                        }
                    });
                } //else if(type === 'bar2') {
                // layer.msg('两个 bar 都可以设定是否开启')
                // }
            }
        });
    });
</script>
</body>
</html>